#pragma once

#include "ScriptCompiler/AST/ExpressionNode.h"

class CScriptToken;
class CBracketNode;
class CDecoratorNode;

class CTypeNode : public CExpressionNode
{

public:
    CTypeNode(std::weak_ptr<CScriptFileContext> InFile)
        : CExpressionNode(InFile, EASTNodeType::Type)
    {
    }

    TVector<std::shared_ptr<CScriptToken>> NameChain;

    TOptional<std::shared_ptr<CScriptToken>> GenericTypeLeftAngleBracket;
    TVector<std::shared_ptr<CTypeNode>> GenericTypes;
    TOptional<std::shared_ptr<CScriptToken>> GenericTypeRightAngleBracket;

    //if type is void(int,float), FunctionParameters is { int,float}
    //and void will be in NameChain
    //TVector<std::shared_ptr<CTypeNode>> FunctionParameters;

    TOptional<std::shared_ptr<CBracketNode>> Bracket; 
    
    bool IsVoidType() const;

    bool IsVarType() const;

    virtual void DebugPrint(int32_t InDepth) override;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() override ;

};